<?php
if (isset($topicList) && count($topicList) > 0) {
    foreach ($topicList as $topicMsg) {
        $topicImg = make_img_name::make_img_micro_name($topicMsg->Picture);
        ?>
        <li class="am-g show_list_content_li">
            <div class="am-u-sm-3">
                <a onclick="goto_topic_show(<?= $topicMsg->Id ?>)">
                    <img src="<?= $CfgPara->httproot ?>/topic_pic/<?= $topicImg ?>" class="am-circle" height="50"
                         width="50"/>
                </a>
            </div>
            <div class=" am-u-sm-7 am-u-end am-list-main">
                <a onclick="goto_topic_show(<?= $topicMsg->Id ?>)">
                    <div class="am-list-item-hd">
                        <b class="app-tittle-color"><?= $topicMsg->Name ?></b>
                    </div>
                    <div class="am-list-item-text">
                        <?php if ($topicMsg->State == 1) { ?>
                            <?= formatDataSize($topicMsg->WorksCount) ?><span>篇作品&nbsp;&nbsp;&nbsp;</span><span
                                    id="topic_up_count_<?= $topicMsg->Id ?>"><?= formatDataSize($topicMsg->UpCount) ?></span>人关注
                        <?php } else { ?>
                            <i class="am-icon am-icon-edit am-icon-fw"></i>草稿
                        <?php } ?>
                    </div>
                </a>
            </div>

            <?php
            if (isset($InputData["list_type"])
                && isset($InputData['work_id'])
                && $InputData["list_type"] == topic_m::ListJoinSele
            ) //投稿选择要加入的专题
            {
                if (!isset($topicMsg->WorkId) || $topicMsg->CheckState == -1) //20170204 修改 -1表示被拒绝，可再投稿
                    echo '<a class="am-fr app-btn-showlist app-btn-follow" onclick="work_for_topic(this)" data-topic-msg="' . $topicMsg->Id . ',' . $InputData['work_id'] . '">加专题</a>';
                elseif ($topicMsg->CheckState == 0)
                    echo '<a class="am-fr app-btn-showlist app-btn-followed">待审核</a>';
                else
                    echo '<a class="am-fr app-btn-showlist app-btn-followed">已加入</a>';
            } elseif (isset($InputData["list_type"])
                && $InputData["list_type"] == topic_m::ListEdit
                && $_SESSION["user_level"] >= 90
            ) //专题编辑
            {
                echo '<a class="am-fr app-btn-showlist app-btn-follow" onclick="act_content(this)" data-forward="controller=topic_edit&topic_edit=1&topic_id=' . $topicMsg->Id . '">&nbsp;编辑&nbsp;</a>';
            } elseif (isset($InputData["list_type"])
                && $InputData["list_type"] == topic_m::ListCheck
                && $_SESSION["user_level"] >= 90
            ) //专题审核
            {
                if ($topicMsg->WaitCheckCount > 0)
                    echo '<a class="am-fr app-btn-showlist app-btn-follow" onclick="act_content(this)" data-forward="controller=works_list&list_type=5&topic_id=' . $topicMsg->Id . '">' . '&nbsp;待审核&nbsp;</a>';
                else
                    echo '<a class="am-fr app-btn-showlist app-btn-followed">&nbsp;无需审核&nbsp;</a>';
            } else {
                if (isset($topicMsg->UserId))
                    echo '<button class="am-fr app-btn-showlist app-btn-followed" onclick="topic_up(this)" data-topic-id="' . $topicMsg->Id . '">已关注</button>';
                else
                    echo '<button class="am-fr app-btn-showlist app-btn-follow" onclick="topic_up(this)" data-topic-id="' . $topicMsg->Id . '">加关注</button>';
            }
            ?>
        </li>
        <?php
    }
} //if(isset($topicList))结束
else //没有内容
{
    if (!isset($InputData['page_change']) || isset($InputData['search_text']))
        require("{$CfgPara->root}/view/warning_nocontent.app.v.php");
}
?>